using System.IO;

namespace SolutionFactory.Services
{
    public class DeleteFileVisitor : MatchingFileVisitor
    {   
        public DeleteFileVisitor(string extension) : base(extension)
        {            
        }

        protected override void VisitMatchingFile(FileInfo file)
        {
            if(file.IsReadOnly)
                file.IsReadOnly = false;

            file.Delete();
        }
    }
}